let Sequelize = require('sequelize');

let config = require('../config');

let webAccountConfig = config.mysql.webAccount;

module.exports = {
    webAccount: new Sequelize(webAccountConfig.db, webAccountConfig.user, webAccountConfig.password, {
        host: webAccountConfig.host,
        port: webAccountConfig.port,
        pool: webAccountConfig.pool,
        dialect: webAccountConfig.dialect,
        dialectOptions: {
            multipleStatements: true
        },
        logging: webAccountConfig.logging && console.log,
        define: {}
    }).authenticate().complete(function(err) {
        if (!!err) {
          console.log('An error occurred while creating the table:', err)
        } else {
          console.log('It worked!')
        }
     }) 
};
